import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "@/views/Layout.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Login",
    component: () => import("@/views/Login.vue"),
    meta: {
      title: "登录界面",
    },
  },
  {
    path: "/login",
    redirect: "/",
  },
  {
    path: "/layout",
    name: "Layout",
    component: Layout,
    redirect: "/layout/home",
    children: [
      {
        path: "synthesize",
        name: "Synthesize",
        component: () => import("@/views/Synthesize.vue"),
        meta: {
          title: "综合态势",
        },
      },
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/Home.vue"),
        meta: {
          title: "热泵系统",
        },
      },
      {
        path: "pumpdetail",
        name: "Pumpdetail",
        component: () => import("@/views/Pumpdetail.vue"),
        meta: {
          title: "热泵详情",
        },
      },
      {
        path: "hotwater",
        name: "Hotwater",
        component: () => import("@/views/Hotwater.vue"),
        meta: {
          title: "热水系统",
        },
      },
      {
        path: "waterDetail",
        name: "WaterDetail",
        component: () => import("@/views/WaterDetail.vue"),
        meta: {
          title: "热水详情",
        },
      },
    ],
  },
  {
    path: "/brand",
    name: "Brand",
    component: () => import("@/views/Brand.vue"),
    meta: {
      title: "公司品牌介绍",
    },
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
